#ifndef __KEYRECOMMANDER_HPP__
#define __KEYRECOMMANDER_HPP__

#include <string>
#include <set>
#include <queue>

using std::string;
using std::set;
using std::priority_queue;

class TcpConnectionPtr;

//关键字推荐执行类
class KeyRecommander
{
public:
    KeyRecommander(string& query,const TcpConnectionPtr& conn);
    ~KeyRecommander() {}

    void execute();

private:
    void queryIndexTable();
    void statistic(set<int>& iset);
    int distance(const string& rhs);
    void response();

private:
    string _queryWord;
    TcpConnectionPtr _conn;
    priority_queue<MyResult,vector<MyResult>,MyCompare> _resultQue;

};




#endif
